<?php
header("Content-Type: text/html;charset=utf-8"); 
class info extends spController
{
	function __construct(){ 
		parent::__construct(); 
		$this->leftcontact = spClass("article_list")->find("id=1166");
        
		$sitesystem=spClass("site_system")->find("id=1"); 
		
		$comma_separated=explode(',',$sitesystem["skeyword"]);
		
		$this->config222=$comma_separated;
		
		$this->sitesystem=$sitesystem;

		$this->promotegoods=spClass('goods_list')->findAll('id>0 and promote=1','sort_id asc,id desc limit 2');
		
		$this->gdlink=spClass('link_list')->findAll();
		
		$this->banner=spClass('page_img')->findAll('nid=1');
		
		$this->banner5=spClass('page_img')->findAll('nid=5');
		
		$this->catlist=spClass('goods_cat')->findAll('pid=0','sort_id asc,id desc');
		
		
		$this->rows = spClass("article_cat")->findAll("pid=4","sort_id asc,id desc");
		
		
        $this->rmwzlist=spClass('article_list')->findall('1=1 and pid in (5,8,58)','zt desc limit 6');
		
		$this->pabtrows = spClass("article_list")->findAll("pid=49","sort_id asc,id asc");
		
		$this->newrows = spClass("article_cat")->findAll("pid=4","sort_id asc,id desc");
		
		$this->newrowslist = spClass("article_list")->findAll("is_top=1","sort_id asc,id desc");
		
		$this->hotnewslist=spClass('article_list')->findAll('pid=5 or pid=8 or pid=69','id desc limit 20');
		
		//$this->catlist=spClass('goods_cat')->findAll('pid=0','sort_id asc,id desc');
		
		$this->cabtrows = spClass("article_list")->findAll("pid=53","sort_id asc,id asc");
		
		$cat_select12  = spClass("goods_cat")->findAll("pid=0","sort_id asc");
		$this->cat_select12=$cat_select12; 
		

	}
	
	function index(){ 
	    
		$id=empty($_GET['id'])?1110:intval($_GET['id']);
		//$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="公司简介";
		$this->abtrows = spClass("article_list")->findAll("pid=49","sort_id asc,id asc");
		
		
		$this->zzrzall = spClass("article_list")->findAll("pid=77","sort_id asc,id desc limit 5");
		
		
		$this->qyzsall = spClass("article_list")->findAll("pid=78","sort_id asc,id desc limit 8");
		
		
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/about.html");
	}
	
	
	function contact(){ 
		$id=empty($_GET['id'])?1251:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="联系我们";
		$this->abtrows= spClass("article_list")->findAll("pid=64","sort_id asc,id asc");
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/contact.html");
	}
	
	
	function gsys(){ 
		$id=empty($_GET['id'])?1796:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="优势";
		$this->vabtrows= spClass("article_list")->findAll("pid=93","sort_id asc,id asc");
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/gsys.html");
	}
	
	
	function tpdz(){ 
		$id=empty($_GET['id'])?1739:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="贴牌定制";
		$this->zsjmabtrows= spClass("article_list")->findAll("pid=90","sort_id asc,id asc");
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/tpdz.html");
	}
	
	
	function jszc(){ 
		$id=empty($_GET['id'])?1560:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="技术支持";
		
		$this->xmabtrows= spClass("article_list")->findAll("pid=80","sort_id asc,id asc");
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/jszc.html");
	}
	
	
	function fzlx(){ 
		//$id=empty($_GET['id'])?1560:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="封装类型";
		if(empty($_GET['id']))
		{
		 $this->fcabtrows = spClass("article_cat")->findAll("pid=68","sort_id asc,id asc");
		 
		}
		else
		{
		 $condition="pid=".$id;
		}
		$this->xmabtrows= spClass("article_list")->findAll($condition,"sort_id asc,id asc");
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/fzlx.html");
	}
	

	function sitemap(){ 
		$id=empty($_GET['id'])?1392:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="网站地图";
		$this->xcabtrows= spClass("article_list")->spPager($this->spArgs('page',1),15)->findAll("pid=61","sort_id asc,id asc");
		$this->pager = spClass('article_list')->spPager()->getPager();
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/sitemap.html");
	}
	
  function jobdetail(){ 
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="招聘贤才";
		$this->cjwtrows = spClass("article_list")->findAll("pid=61","sort_id asc,id desc");
		
		//上一篇
		
		  $this->previ = spClass("article_list")->find("pid=61 and id >".$id,"sort_id asc,id desc"); 

		  
	    //下一篇
		
		$this->next = spClass("article_list")->find("pid=61 and id <".$id,"sort_id asc,id desc"); 
		
		$this->row = spClass("article_list")->find("id=".$id);
		
		$this->display("index/jobdetail.html");
	}
	
   function qyxc(){ 
		$id=empty($_GET['id'])?1259:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="企业相册";
		
		$this->abtrows = spClass("article_list")->findAll("pid=49","sort_id asc,id asc");
		
		$this->xcabtrows= spClass("article_list")->spPager($this->spArgs('page',1),9)->findAll("pid=87","sort_id asc,id asc");
		
		$this->pager = spClass('article_list')->spPager()->getPager();
		
		$this->row = spClass("article_list")->find("id=".$id);
		
		$this->display("index/qyxc.html");
	}
	
  function qyxcdetail(){ 
  
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		
		$this->config=spClass("site_system")->find("id=1"); 
		
		$this->menuIndex=3;
		
		$this->ctitle="企业相册";
		
		$this->cjwtrows = spClass("article_list")->findAll("pid=61","sort_id asc,id desc");
		
		$this->abtrows = spClass("article_list")->findAll("pid=49","sort_id asc,id asc");
		
		
		//上一篇
		
		  $this->previ = spClass("article_list")->find("pid=87 and id >".$id,"sort_id asc,id desc"); 

		  
	    //下一篇
		
		$this->next = spClass("article_list")->find("pid=87 and id <".$id,"sort_id asc,id desc"); 
		
		$this->row = spClass("article_list")->find("id=".$id);
		
		$this->display("index/qyxcdetail.html");
	}
	
  function download(){ 
		$id=empty($_GET['id'])?98:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="服务支持";
		
		$this->dwcate = spClass("article_cat")->findAll("pid=90","sort_id asc,id asc");
		
		$condition="pid=".$id;
		
		$this->rowsname = spClass("article_cat")->find("id=".$id,"sort_id asc,id desc");
		
		$this->downinfo = spClass('article_list')->spPager($this->spArgs('page',1),10)->findAll($condition,'add_time desc,sort_id asc');
		$this->pager = spClass('article_list')->spPager()->getPager();
		//$this->caterows = spClass("article_list")->findAll("pid=25","sort_id asc,id desc");
		//$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/download.html");
	}
	
  function downloaddetail(){ 
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="服务支持";
		
		$this->dwcate = spClass("article_cat")->findAll("pid=90","sort_id asc,id asc");
		
		$sql="update my_article set zt=zt+1 where id=$id";
		
		$ztrow=spClass('article_list')->findsql($sql);
		
		$this->cjwtrows = spClass("article_list")->findAll("pid=61","sort_id asc,id desc");
		
		
		
		
		$row=spClass("article_list")->find("id=".$id);
		
		$this->pcat = spClass('article_cat')->find("id=".$row['pid']);
		
		//上一篇
		
		  $this->previ = spClass("article_list")->find("pid=".$row["pid"]." and id >".$id,"sort_id asc,id desc"); 

		  
	    //下一篇
		
		$this->next = spClass("article_list")->find("pid=".$row["pid"]." and id <".$id,"sort_id asc,id desc"); 
		
		
		$this->xgsprow = spClass("article_list")->findAll("pid=68","sort_id asc,id desc");
		
		
		$this->row =$row;
		
		$this->display("index/downloaddetail.html");
	}
	
	
	
	
	
  function cgal(){ 
		$id=empty($_GET['id'])?88:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="成功案例";
		
		$this->aanlicate = spClass("article_cat")->findAll("pid=78","sort_id asc,id asc");
		
		$condition="pid=".$id;
		
		$this->rowsname = spClass("article_cat")->find("id=".$id,"sort_id asc,id desc");
		
		$this->ddowninfo = spClass('article_list')->spPager($this->spArgs('page',1),15)->findAll($condition,'add_time desc,sort_id asc');
		$this->pager = spClass('article_list')->spPager()->getPager();
		//$this->caterows = spClass("article_list")->findAll("pid=25","sort_id asc,id desc");
		//$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/cgal.html");
	}
	
  function cgaldetail(){ 
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="成功案例";
		
		$this->aanlicate = spClass("article_cat")->findAll("pid=78","sort_id asc,id asc");
		
		$sql="update my_article set zt=zt+1 where id=$id";
		
		$ztrow=spClass('article_list')->findsql($sql);
		
		$this->cjwtrows = spClass("article_list")->findAll("pid=61","sort_id asc,id desc");
		
		
		$row=spClass("article_list")->find("id=".$id);
		
		$this->pcat = spClass('article_cat')->find("id=".$row['pid']);
		
		//上一篇
		
		  $this->previ = spClass("article_list")->find("pid=".$row["pid"]." and id >".$id,"sort_id asc,id desc"); 

		  
	    //下一篇
		
		$this->next = spClass("article_list")->find("pid=".$row["pid"]." and id <".$id,"sort_id asc,id desc"); 
		
		
		$this->xgsprow = spClass("article_list")->findAll("pid=68","sort_id asc,id desc");
		
		
		$this->row =$row;
		
		$this->display("index/cgaldetail.html");
	}
	
	
	
    function spzx(){ 
		$id=empty($_GET['id'])?1259:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="视频专区";
		$this->abtrows = spClass("article_list")->findAll("pid=49","sort_id asc,id asc");
		$this->xcabtrows= spClass("article_list")->spPager($this->spArgs('page',1),15)->findAll("pid=91","sort_id asc,id asc");
		$this->pager = spClass('article_list')->spPager()->getPager();
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/spzx.html");
	}
	
  function spzxdetail(){ 
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="视频专区";
		
		$this->abtrows = spClass("article_list")->findAll("pid=49","sort_id asc,id asc");
		
		$this->cjwtrows = spClass("article_list")->findAll("pid=61","sort_id asc,id desc");
		
		//上一篇
		
		  $this->previ = spClass("article_list")->find("pid=91 and id >".$id,"sort_id asc,id desc"); 

		  
	    //下一篇
		
		$this->next = spClass("article_list")->find("pid=91 and id <".$id,"sort_id asc,id desc"); 
		
		$this->row = spClass("article_list")->find("id=".$id);
		
		$this->display("index/spzxdetail.html");
	}
	

  function hzhb(){ 
		$id=empty($_GET['id'])?1252:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="合作客户";
		$this->hzkhrows= spClass("article_list")->spPager($this->spArgs('page',1),12)->findAll("pid=97","sort_id asc,id asc");
		$this->pager = spClass('article_list')->spPager()->getPager();
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/hzhb.html");
	}
	
  function hzhbdetail(){ 
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="合作客户";
		$this->cjwtrows = spClass("article_list")->findAll("pid=61","sort_id asc,id desc");
		
		//上一篇
		
		  $this->previ = spClass("article_list")->find("pid=97 and id >".$id,"sort_id asc,id desc"); 
		  
	    //下一篇
		
		$this->next = spClass("article_list")->find("pid=97 and id <".$id,"sort_id asc,id desc"); 
		
		$this->row = spClass("article_list")->find("id=".$id);
		
		$this->display("index/hzhbdetail.html");
	}
	
	
  function khjz(){ 
		$id=empty($_GET['id'])?1252:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="客户见证";
		$this->khjzrows= spClass("article_list")->spPager($this->spArgs('page',1),6)->findAll("pid=92","sort_id asc,id asc");
		$this->pager = spClass('article_list')->spPager()->getPager();
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/khjz.html");
	}
	
  function khjzdetail(){ 
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="客户见证";
		$this->cjwtrows = spClass("article_list")->findAll("pid=61","sort_id asc,id desc");
		
		//上一篇
		
		  $this->previ = spClass("article_list")->find("pid=92 and id >".$id,"sort_id asc,id desc"); 
		  
	    //下一篇
		
		$this->next = spClass("article_list")->find("pid=92 and id <".$id,"sort_id asc,id desc"); 
		
		$this->row = spClass("article_list")->find("id=".$id);
		
		$this->display("index/khjzdetail.html");
	}

   function ldown(){ 
		$id=empty($_GET['id'])?1252:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="资料下载";
		$this->zlxzrows= spClass("article_list")->spPager($this->spArgs('page',1),15)->findAll("pid=68","sort_id asc,id asc");
		$this->pager = spClass('article_list')->spPager()->getPager();
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/ldown.html");
	}
	
  function ldowndetail(){ 
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="资料下载";
		$this->cjwtrows = spClass("article_list")->findAll("pid=61","sort_id asc,id desc");
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/ldowndetail.html");
	}
	
   function ryzz(){ 
		$id=empty($_GET['id'])?1323:intval($_GET['id']);
		$this->sitesystem=spClass("site_system")->find("id=1"); 
		$this->menuIndex=2;
		$this->ctitle="荣誉资质";
		//$this->cjwtrows = spClass("article_list")->findAll("pid=61","sort_id asc,id desc");
		$this->ryzzrows= spClass("article_list")->spPager($this->spArgs('page',1),10)->findAll("pid=91","sort_id asc,id asc");
		$this->pager = spClass('article_list')->spPager()->getPager();
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/ryzz.html");
	}
	
  function ryzzdetail(){ 
         
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="荣誉资质";
		$this->cjwtrows = spClass("article_list")->findAll("pid=61","sort_id asc,id desc");
		//上一篇
		  $this->previ = spClass("article_list")->find("pid=91 and id >".$id,"sort_id asc,id desc"); 
	   //下一篇
		$this->next = spClass("article_list")->find("pid=91 and id <".$id,"sort_id asc,id desc"); 

		$this->row = spClass("article_list")->find("id=".$id);
		
		$this->display("index/ryzzdetail.html");
		
	}
	
	
	
	function jobadd(){ 
		//$id=empty($_GET['id'])?1109:intval($_GET['id']);
		 $zhiwei=$_REQUEST['zhiwei'];
		 $upfile     = empty($_FILES['jianli']['name'])?$this->error("文件上传",spUrl("info","jobadd")):$_FILES['jianli']['name'];   //产品封面图
		if(!empty($upfile)){
			$pic=upload('member','jpg,gif,rar,pdf,docx,doc,xls,zip',2048000000,1,'157*130',0);
		}
		
	   $newrow = array(
			'username'      => $zhiwei,
			'company'     => $pic[0],
			'addtime'   => time(),
		);
	    //运行添加的动作
		$row=spClass('member_list')->create($newrow);
		if($row){
			$this->error("文件上传成功！");	
			spUrl("info","job");
		}else{
			$this->error("操作失败，请联系网站管理员");	
			spUrl("info","job");
		}
		 
	}
	
  function down(){ 
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="下载中心";
		$this->downcate = spClass("article_cat")->findAll("pid=58","sort_id asc,id asc");
		
		$condition="pid=".$id;
		
		$this->rowsname = spClass("article_cat")->find("id=".$id,"sort_id asc,id desc");
		
		$this->downinfo = spClass('article_list')->spPager($this->spArgs('page',1),10)->findAll($condition,'add_time desc,sort_id asc');
		//$this->caterows = spClass("article_list")->findAll("pid=25","sort_id asc,id desc");
		//$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/down.html");
	}
	
	
	
	function guestbook(){ 
		$id=empty($_GET['id'])?1109:intval($_GET['id']);
		$this->config=spClass("site_system")->find("id=1"); 
		$this->menuIndex=3;
		$this->ctitle="销售网络";
		$this->caterows = spClass("article_list")->findAll("pid=25","sort_id asc,id desc");
		$this->row = spClass("article_list")->find("id=".$id);
		$this->display("index/guestshow.html");
	}
	
	
	function search(){ 
		
		$this->title    = spClass("site_config")->find("id=101");  
		$this->keywords = spClass("site_config")->find("id=104");  
		$this->desc     = spClass("site_config")->find("id=103");
		
		$this->cats=spClass('article_list')->findAll('pid=1',"sort_id asc,id desc");
		
		$bcat=spClass('article_cat')->findAll('pid=1',"sort_id asc,id desc");
		
		foreach($bcat as $bid=>$bvalue){
			$bcat[$bid]['second']=spClass('article_list')->findAll('pid='.$bcat[$bid]['id'],"sort_id asc,id desc");
		}
		
		$this->bcat=$bcat;
		
		$keyword=empty($_REQUEST['keyword'])?"":htmlspecialchars($_REQUEST['keyword']);

		
		$sql="SELECT a.title,a.add_time,a.pid,a.id,g.sort_id,g.catename,IF(a.tid=0,1000,g.sort_id) as fuckid FROM sp_article a LEFT JOIN sp_goods_color g ON a.tid=g.id WHERE a.title like '%".$keyword."%' ORDER BY fuckid asc,add_time desc";
		
		// $this->news = spClass('article_list')->findAll('title like \'%'.$keyword.'%\'');
		
		$this->news = spClass('article_list')->spPager($this->spArgs('page', 1), 100)->findSql($sql);  
		$this->pager = spClass('article_list')->spPager()->getPager(); 
		
		$this->display("index/search.html");
	}
	
	
	function email(){ 
		
		$this->title    = spClass("site_config")->find("id=101");  
		$this->keywords = spClass("site_config")->find("id=104");  
		$this->desc     = spClass("site_config")->find("id=103");
		
		$this->cats=spClass('article_list')->findAll('pid=1',"sort_id asc,id desc");
		
		$bcat=spClass('article_cat')->findAll('pid=1',"sort_id asc,id desc");
		
		foreach($bcat as $bid=>$bvalue){
			$bcat[$bid]['second']=spClass('article_list')->findAll('pid='.$bcat[$bid]['id'],"sort_id asc,id desc");
		}
		
		$this->bcat=$bcat;
		

		
		$this->display("index/email.html");
	}
	
	


}	